const SUCCESS_CODE = 200;
const FAIL_CODE = 501;
const NOT_EXIST_CODE = 404;

class ResultModel {
  constructor() {
    this.msg = "";
    this.code = 0;
    this.data = null;
  }

  setSuccessCode() {
    this.code = SUCCESS_CODE;
  }

  setFailureCode() {
    this.code = FAIL_CODE;
  }

  setMsg(msg) {
    this.msg = msg;
  }

  setData(data) {
    this.data = data;
  }
}

module.exports = ResultModel;
